[#ftl]
 [@define "agile.form._FormSelectWidget" "agile.form._FormValueWidget,agile._Resizable"]	
	resizeAxis:"x"
	,attributes:lang.delegate(agile.form._FormValueWidget.prototype.attributes,{
		options:lang.mixin({},agile.SelectOptionMetadata,{
			label:"i18n_options",placeHolder:"value=label,value=label"
		})
		[#--TODO
		,pageSize,searchDelay:lang.mixin({},agile.NumberMetadata,{
			label:"i18n_page_size"
		})
		,store:lang.mixin({},agile.TextMetadata,{
			label:"i18n_store"
		})
		,query:lang.mixin({},agile.ObjectMetadata,{
			label:"i18n_query"
		})
		,searchDelay:lang.mixin({},agile.NumberMetadata,{
			label:"i18n_search_delay",unit:"ms"
		})
		,searchAttr:lang.mixin({},agile.TextMetadata,{
			label:"i18n_search_attribute"
		})
		,queryExpr:lang.mixin({},agile.TextMetadata,{
			label:"i18n_query_expression"
		})
		,ignoreCase:lang.mixin({},agile.BooleanMetadata,{
			label:"i18n_ignore_case"
		})
		--]
//	TODO: enhance combox/filtering-select/multi-select to support key/value mapping
//	,value:	lang.mixin({},agile.TextMetadata,{label:"i18n_value"
//			,onValueChange:function(/*widget*/widget,/*String*/name,/*Object*/value){
//				//convert the code to label according to mapping in the options
//				var newValue = value;
//				var options = widget.metadata("parameters.options");
//		 		for(var i = options.length - 1; i >= 0; i--){
//		 			if(options[i].value == value){
//		 				newValue = options[i].label;
//		 				break;
//		 			}
//		 		}
//		 		widget.delegate.reset1("value",newValue);
//		 		widget.metadata("parameters.value",value);	
//			}			
//		})
		
	})
	,getResizableTargetContainer:function(){				
		return this.delegate.domNode;		 
	}
 	,init:function(){		
//		this.delegate.addOption(this.metadata("parameters.options"));
//		if(!this.delegate.get("store")){
//			this.delegate.set("store",new Memory({data:[]}));			
//		}
//		var searchAttr = this.metadata("parameters.searchAttr");
//		this.delegate.set("searchAttr",searchAttr?searchAttr:"value");
//		
//		//console.log(this.declaredClass,"[_FormSelectWidget]parameters.options",this.metadata("parameters.options"));
//		if(this.metadata("parameters.options")){
//			this.delegate.get("store").data = this.metadata("parameters.options");
//		}
 		this.delegate.set("options",this.metadata("parameters.options"));
	}
// 	TODO: enhance combox/filtering-select/multi-select to support key/value mapping
// 	,onValueChange:function(newValue){
// 		//convert the selected item's label to value (code)
// 		var options = this.metadata("parameters.options");
// 		for(var i = options.length - 1; i >= 0; i--){
// 			if(options[i].label == newValue){
// 				newValue = options[i].value;
// 				break;
// 			}
// 		}
//		topic.publish("agile.widget.changed",this.category,"value",newValue);					
//		this.metadata("parameters.value",newValue);	
//	}
[/@]
